package java6681.javafx;



import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;


public class FirstWinDemo extends Application {
    public static void main(String[] args) {
        launch(args);
    }
    @Override
    public void start(Stage primaryStage) {
        VBox root = new VBox();//VBox垂直布局
        Button button = new Button("JavaFx窗口");
        Button button1 = new Button();
//        添加子节点
        root.getChildren().add(button);
//        位置居中
        root.setAlignment(Pos.CENTER);
        Scene scene = new Scene(root, 300, 300);
        primaryStage.setScene(scene);
        primaryStage.setTitle("第一个窗口");
        primaryStage.show();
    }
}
